//获取id
function gId(field,ero){return '#'+syAssemblyId+'_'+ero+'_form_'+field;}
//页面启动时
function syAssemblyonload(){
}

//打开新建页面时
function syAssemblyAddOnOpen(){
  log('这是新建表单哦');
	eSet(gId('createuserid','add'),getCurrentUserId());
	eEnable(gId('createuserid','add'),false);
	$(gId('html_tooltip','add')).tooltip({
		content:htot('\'<input  id="\'+ eId+ \'"  type="text" \'+ (colobj.form.classname == undefined ? \'\' : \'class="\'		+ colobj.form.classname + \'"\')+ \'  \'+ (colobj.form.style?\'style="\'	+ colobj.form.style + \'"\':\'\')+ \'  \'+ (colobj.form.dataoptions == undefined ? \'\'		: \'data-options="\' + colobj.form.dataoptions + \'"\')+ \' \'+ (colobj.form.readonly == true ? \' readonly="readonly"\': \'\')+ \' \'+ (colobj.form.attribute == undefined ? \'\'		: \'"\' + colobj.form.attribute + \'"\')+ \' \'+ (colobj.form.type == undefined ? \'reftype="\'		+ eType.Input + \'"\' : \'reftype="\'		+ colobj.form.type + \'"\') + \' ></input>\';')
	});
	$(gId('propety_tooltip','add')).tooltip({
		content:'{"name" : "选择框","ref":"checkbox","value" : "","group" : "类型","help":"如果设置为true，该字段将以checkbox的形式展现于页面中。<br/>填写方法：直接选中单选框即为true","editor":{	"type":"checkbox",	"options":{		"on":true,		"off":false	}}}'
	});
	eSet(gId('getscript','add'),"//obj.combobox('getValue');");
	eSet(gId('setscript','add'),"//obj.datebox('setValue', v);");
	eSet(gId('classname','add'),"'easyui-combobox';");
	eSet(gId('propety','add'),'{"name" : "选择框","ref":"checkbox","value" : "","group" : "类型","help":"如果设置为true，该字段将以checkbox的形式展现于页面中。<br/>填写方法：直接选中单选框即为true","editor":{	"type":"checkbox",	"options":{		"on":true,		"off":false	}}}');
	eSet(gId('html','add'),'\'<input  id="\'+ eId+ \'"  type="text" \'+ (colobj.form.classname == undefined ? \'\' : \'class="\'		+ colobj.form.classname + \'"\')+ \'  \'+ (colobj.form.style?\'style="\'	+ colobj.form.style + \'"\':\'\')+ \'  \'+ (colobj.form.dataoptions == undefined ? \'\'		: \'data-options="\' + colobj.form.dataoptions + \'"\')+ \' \'+ (colobj.form.readonly == true ? \' readonly="readonly"\': \'\')+ \' \'+ (colobj.form.attribute == undefined ? \'\'		: \'"\' + colobj.form.attribute + \'"\')+ \' \'+ (colobj.form.type == undefined ? \'reftype="\'		+ eType.Input + \'"\' : \'reftype="\'		+ colobj.form.type + \'"\') + \' ></input>\';');
	var mime="javascript";
	toCodeMir(gId('getscript','add'),mime);
	toCodeMir(gId('setscript','add'),mime);
	toCodeMir(gId('classname','add'),mime);
	toCodeMir(gId('html','add'),mime);
	toCodeMir(gId('propety','add'),mime);
}

function toCodeMir(id,mime){
	CodeMirror.fromTextArea($(id)[0], {
	    mode: mime,
	    indentWithTabs: true,
	    smartIndent: true,
	    lineWrapping:true,
	    lineNumbers: true,
	    matchBrackets : true,
	    autofocus: true
	  });
}

//打开编辑页面时
function syAssemblyEditOnOpen(){
	var mime="javascript";
	toCodeMir(gId('getscript','edit'),mime);
	toCodeMir(gId('setscript','edit'),mime);
	toCodeMir(gId('classname','edit'),mime);
	toCodeMir(gId('html','edit'),mime);
	toCodeMir(gId('propety','edit'),mime);
	$(gId('html_tooltip','edit')).tooltip({
		content:htot('\'<input  id="\'+ eId+ \'"  type="text" \'+ (colobj.form.classname == undefined ? \'\' : \'class="\'		+ colobj.form.classname + \'"\')+ \'  \'+ (colobj.form.style?\'style="\'	+ colobj.form.style + \'"\':\'\')+ \'  \'+ (colobj.form.dataoptions == undefined ? \'\'		: \'data-options="\' + colobj.form.dataoptions + \'"\')+ \' \'+ (colobj.form.readonly == true ? \' readonly="readonly"\': \'\')+ \' \'+ (colobj.form.attribute == undefined ? \'\'		: \'"\' + colobj.form.attribute + \'"\')+ \' \'+ (colobj.form.type == undefined ? \'reftype="\'		+ eType.Input + \'"\' : \'reftype="\'		+ colobj.form.type + \'"\') + \' ></input>\';')
	});
	$(gId('propety_tooltip','edit')).tooltip({
		content:'{"name" : "选择框","ref":"checkbox","value" : "","group" : "类型","help":"如果设置为true，该字段将以checkbox的形式展现于页面中。<br/>填写方法：直接选中单选框即为true","editor":{	"type":"checkbox",	"options":{		"on":true,		"off":false	}}}'
	});
	}

//点击新建按钮时
function AddBtnClick(){
	return true;
}
//点击编辑按钮时
function EditBtnClick(){
	return true;
}